package com.sixth.core.handler;/**
 * @author 633yh
 * @version 1.0
 */

import com.sixth.core.vo.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author     ：Stu YH
 * @date       ：Created in 2024/8/14 15:53
 * @description：
 * @modified By：
 * @version:
 */
@RestControllerAdvice  //处理controller层的异常
public class MyGlobalHandler {

    @ExceptionHandler(Exception.class)
    public R error(Exception e){
        e.printStackTrace();
        return R.error(e.getMessage());
    }
}